/*
 * 
 */
(function(window){

var LOG = {
	logLevel:1,	
	LEVEL_DEBUG:0,
	LEVEL_INFO:1,
	LEVEL_WARN:2,
	LEVEL_ERROR:3,
	LEVEL_FAULT:4
};

var Env;
(function(){
	var userAgent = navigator.userAgent.toLowerCase(),
		isFirefox = /firefox/.test(userAgent),
		isOpera   = /opera/.test(userAgent),
		isSafari  = /webkit/.test(userAgent),
		isIE      = /msie/.test(userAgent) && !/opera/.test(userAgent),
		isIE6     = /msie 6/i.test(navigator.appVersion),
		browserVersion = (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
		isIElt8   = this.isIE && (this.browserVersion-0 < 8); 
	
	var isIpad = isAppleIpad();
	function isAppleIpad() {
		return (navigator.platform.indexOf('iPad') != -1);
	};
})();


(/** @this window */function(){
	this.log = function(){
		
	};
	
	function debug() {
		if(LOG.level > LOG.DEBUG)return;
		if (typeof obj == "undefined") {
			console.debug(string);
		} else if (isIpad) {
			console.debug(string + " " + objInfo(obj));
		} else {
			console.debug(string, obj);
		}
	}
	
}).apply(window);


function warn(msg, obj){
	if(logLevel>LEVEL_WARN)return;
	if(console){
		console.warn(msg,obj);
	}
}

function debug(msg, obj){
	if(logLevel>LEVEL_DEBUG)return;
	if(console){
		if(isIE){
			return;
		}else{
			console.debug(msg,obj);
		}
	}
}

function info(msg, obj){
	if(logLevel>LEVEL_INFO)return;
	if(console){
		if(isIE){
			return;
		}else{
			console.info(msg,obj);
		}
	}
}

function log(msg, obj){
	if(logLevel>LEVEL_INFO)return;
	if(console){
		if(isIE){
			return;
		}else{
			console.log(msg,obj);
		}
	}
}

function error(msg, obj){
	if(logLevel>LEVEL_ERROR)return;
	if(console){
		if(isIE){
			return;
		}else{
			console.error(msg, obj);
		}
	}
}
})(window);